: <> generated: 2023-Feb-20 10:43:07
: <> family: CaV
: <> type: HodgkinHuxleyAlphaBeta
: <> model: Eyring
: <> institution: EPFL
: <> lab: BBP
: <> host_cell: CHO_FT
: <> ion_channel: Cav3.1_cop
: <> species: Mouse
: <> temp: 25

NEURON {
    SUFFIX Cav3_1
    USEION ca READ eca WRITE ica
    RANGE gca, ica, gcabar
}

: ========== VARIABLES ==========

UNITS {
    (S) = (siemens)
    (mV) = (millivolt)
    (mA) = (milliamp)
}

PARAMETER {
    gcabar = 1.265337e+00 (S / cm2)
    P01 = 3.154781e+00 (1 / ms)
    P02 = 6.310587e-02 (1 / mV)
    P03 = 1.314125e+01 (mV)
    P04 = 9.023417e-05 (1 / ms)
    P05 = 1.218596e-01 (1 / mV)
    P06 = 1.187726e-01 (1 / ms)
    P07 = 5.783919e-02 (1 / mV)
    P08 = 4.286225e+01 (mV)
    P09 = 1.629624e-05 (1 / ms)
    P10 = 7.453425e-02 (1 / mV)
}

ASSIGNED {
    v (mV)
    eca (mV)
    ica (mA / cm2)
    gca (S / cm2)
    m_inf
    h_inf
    m_tau (ms)
    h_tau (ms)
}

: ========== FUNCTION DEFINITIONS ==========

FUNCTION mAlpha (vm (mV)) (1 / ms) {
    mAlpha = P01 / (1 + exp(-P02 * (vm + P03)))
}

FUNCTION mBeta (vm (mV)) (1 / ms) {
    mBeta = P04 * exp(-P05 * vm)
}

FUNCTION hAlpha (vm (mV)) (1 / ms) {
    hAlpha = P06 / (1 + exp(-P07 * (vm + P08)))
}

FUNCTION hBeta (vm (mV)) (1 / ms) {
    hBeta = P09 * exp(-P10 * vm)
}

FUNCTION mTau (vm (mV)) (ms) {
    mTau = 1 / (mAlpha(vm) + mBeta(vm))
}

FUNCTION hTau (vm (mV)) (ms) {
    hTau = 1 / (hAlpha(vm) + hBeta(vm))
}

FUNCTION mInf (vm (mV)) {
    mInf = mAlpha(vm) * mTau(vm)
}

FUNCTION hInf (vm (mV)) {
    hInf = hBeta(vm) * hTau(vm)
}

PROCEDURE rates() {
    m_tau = mTau(v)
    h_tau = hTau(v)
    m_inf = mInf(v)
    h_inf = hInf(v)
}

: ========== PROGRAM ==========

STATE {
    m
    h
}

INITIAL {
    rates()
    m = m_inf
    h = h_inf
}

BREAKPOINT {
    SOLVE states METHOD cnexp
    gca = gcabar * m * m * h
    ica = gca * (v - eca)
}

DERIVATIVE states {
    rates()
    m' = (m_inf  - m) / m_tau
    h' = (h_inf  - h) / h_tau
}
